<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h3>插槽的后备内容</h3>
      <child></child>
    </div>

    <script src="../../Vue.js"></script>
    <script>
      // slot标签中间写的内容会作为插槽的默认内容
      const Child = {
        template: `
          <div>child组件 - <slot>666</slot></div>
        `,
      };

      new Vue({
        el: "#app",
        data: {},
        components: {
          Child,
        },
      });
    </script>
  </body>
</html>
